﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.HumanAffairs.Promotions;
using Volo.Abp.Application.Services;

namespace TianShiProject.HumanAffairs.Promotions
{
    public class PromotionService : ApplicationService
    {
        private readonly IPromotionRepository _promotionRepository;
        public PromotionService(IPromotionRepository promotionRepository)
        {
            _promotionRepository = promotionRepository;
        }

        #region 转正办理——查询分页显示
        /// <summary>
        /// 转正办理——查询分页显示
        /// </summary>
        /// <param name="PromotionName"></param>
        /// <param name="DeptId"></param>
        /// <param name="PositionId"></param>
        /// <param name="EntryTime"></param>
        /// <param name="ApplyTime"></param>
        /// <param name="State"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<PromotionDto>> GetPromotionPageShow(string PromotionName, int DeptId, int PositionId, DateTime? EntryTime, DateTime? ApplyTime, int State, int pageindex = 1, int pagesize = 3)
        {
            return await _promotionRepository.GetPromotionPageShow(PromotionName, DeptId, PositionId, EntryTime, ApplyTime, State, pageindex, pagesize);
        }
        #endregion

        #region 转正办理——逻辑删除
        /// <summary>
        /// 转正办理——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeletePromotion(int id)
        {

            return await _promotionRepository.DeletePromotion(id);
        }
        #endregion

        #region 转正办理——批量删除
        /// <summary>
        /// 转正办理——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<int> DeleteBatchPromotion(string ids)
        {
            return await _promotionRepository.DeleteBatchPromotion(ids);
        }
        #endregion

        #region 转正办理——编辑
        /// <summary>
        /// 转正办理——编辑
        /// </summary>
        /// <param name="promotionDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdatePromotion(PromotionDto promotionDto)
        {
            return await _promotionRepository.PutUpdatePromotion(promotionDto);
        }
        #endregion

        #region 转正办理——添加
        /// <summary>
        /// 转正办理——添加
        /// </summary>
        /// <param name="promotionDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddPromotion(PromotionDto promotionDto)
        {
            return await _promotionRepository.PostAddPromotion(promotionDto);
        }
        #endregion
    }
}
